package com.xin.di.uav.applet.rest;

import com.xin.di.uav.applet.po.SpecialPricing;
import com.xin.di.uav.applet.service.ISpecialPricingService;
import com.xin.di.uav.common.request.pricing.SpecialPricingReq;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * <p>
 * 定价表 前端控制器
 * </p>
 *
 * @author LTQ
 * @since 2024-11-13
 */
@Controller
@RequestMapping("/applet/specialPricing")
public class SpecialPricingRest {

    @Autowired
    private ISpecialPricingService iSpecialPricingService;

    public SpecialPricing getPrice(String takeoffCode, String landingCode, String pricingId) {
        return iSpecialPricingService.getPrice(takeoffCode, landingCode, pricingId);
    }

    /**
     * 新增特殊定价
     *
     * @param specialPricingReqList
     * @return
     */
    public Boolean addBatchSpecialPricing(List<SpecialPricingReq> specialPricingReqList) {
        return iSpecialPricingService.addBatchSpecialPricing(specialPricingReqList);
    }

    /**
     * 更新特殊定价
     *
     * @param pricingId             定价ID
     * @param specialPricingIds     需要保留的历史特殊定价ID集合
     * @param specialPricingReqList 全部传入的特殊定价集合
     * @return
     */
    public Boolean saveOrUpdateSpBatch(String pricingId, List<String> specialPricingIds, List<SpecialPricingReq> specialPricingReqList) {
        return iSpecialPricingService.saveOrUpdateSpBatch(pricingId, specialPricingIds, specialPricingReqList);
    }
}
